﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp3
{
    class Shape
    {

        public virtual void GetArea()
        {

        }
        public void CallArea(Shape aa)
        {
            aa.GetArea();

        }
    }
    class Circle : Shape
    {
        public Circle(Double a)
        {
            radius = a;
        }
        public double radius { get; set; }
        public override void GetArea()
        {

            base.GetArea();
            Console.WriteLine("圆的面积为" + (radius * radius * 3.14));
        }

    }
    class Square : Shape
    {
        public Square(Double a)
        {
            sideLen = a;
        }
        public double sideLen { get; set; }

        public override void GetArea()
        {

            base.GetArea();
            Console.WriteLine("正方形的面积为" + (sideLen * sideLen));
        }
    }
}